fix: enrichment redeploy loop and lowercase env name#60
Merged
TerrifiedBug merged 1 commit intomainfrom Mar 7, 2026
Merged
Conversation
…e env name The pipeline.get endpoint was comparing YAML without enrichment transforms against deployed YAML that had them baked in. This caused two bugs: 1. Toggling enrichMetadata ON didn't show "pending deploy" in the editor because both comparison sides lacked enrichment transforms. 2. After deploying with enrichment enabled, the editor always showed "pending deploy" because the non-enriched comparison YAML never matched the enriched deployed YAML, creating an infinite redeploy loop. Fix: pass the same enrichment parameters to generateVectorYaml in pipeline.get as pipeline.list already does, using the deployed version number so the comparison is stable. Also lowercase the environment name in enrichment metadata output.
Contributor
Greptile SummaryThis PR fixes two related bugs in the pipeline editor's "pending deploy" detection and corrects the casing of environment names in enrichment metadata.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant pipeline.get
participant DB (Prisma)
participant generateVectorYaml
Client->>pipeline.get: query({ id })
pipeline.get->>DB (Prisma): findUnique(pipeline)<br/>include environment { name } + nodes + edges
DB (Prisma)-->>pipeline.get: pipeline (with environment.name)
pipeline.get->>DB (Prisma): findFirst(latestVersion)<br/>select { configYaml, logLevel, version }
DB (Prisma)-->>pipeline.get: latestVersion (with .version)
alt enrichMetadata = true
pipeline.get->>pipeline.get: enrichment = { environmentName, pipelineVersion }
else enrichMetadata = false
pipeline.get->>pipeline.get: enrichment = null
end
pipeline.get->>generateVectorYaml: (nodes, edges, globalConfig, enrichment)
note over generateVectorYaml: if enrichment: inject remap transform<br/>with environmentName.toLowerCase()
generateVectorYaml-->>pipeline.get: currentYaml
pipeline.get->>pipeline.get: hasConfigChanges = (currentYaml !== latestVersion.configYaml)
pipeline.get-->>Client: { ...pipeline, hasConfigChanges }
Last reviewed commit: d8af578 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pipeline.getwas comparing YAML without enrichment transforms against deployed YAML that had them baked in — they could never match, so "pending deploy" always showed after any enrichment-enabled deploy.enrichMetadataON, the editor didn't detect a configuration change because both comparison sides lacked enrichment."production"instead of"Production").Root cause
pipeline.get(editor/detail view) was missing theenrichmentparameter in its call togenerateVectorYaml(). Thepipeline.listendpoint already had this fix, butpipeline.getwas missed.Changes
src/server/routers/pipeline.ts: Addnameto environment select,versionto latestVersion select, and pass enrichment togenerateVectorYaml()inpipeline.getsrc/lib/config-generator/yaml-generator.ts: Lowercase environment name in VRL enrichment sourceTest plan